
cd "YOUR_PATH/PRQ_replication_materials/data"

********************************************************************************
* Check differences in Fridays between Tunisia and Egypt using pop. exposure
********************************************************************************
use diffdat.dta

nbreg ppart friday if tunisia==0, exp(pop)
est store egy

nbreg ppart friday if tunisia==1, exp(pop)
est store tun

estimates table egy tun, star stats(N ll)
suest egy tun
test [egy_ppart = tun_ppart], cons

esttab, ///
se(3) b(3) mtitle("Model 1: Egypt versus Tunisia") /// 
 label nonumber noobs nobaselevels eqlabels(none) drop(_cons) scalars("refcat non-Friday") ///
 title("Seemingly unrelated estimation: Egypt and Tunisia Friday protest participation.")

********************************************************************************
* Gender interaction in Arab Barometer Wave II data
********************************************************************************

use ABII_English.dta, clear

keep if country==21|country==5
recode q1002(2=1 "female")(1=0 "male"), into(gender)

recode eg802(1=1 "yes")(2=0 "no"), into(revpartegy)
recode t902(1=1 "yes")(2=0 "no")(8 9=.),into(revpartun)


recode t912(1=1 "yes")(2=0 "no"), into(prpart)
recode eg812(1=1 "yes")(2=0 "no"), into(prparteg)

gen tunisia=1 if country==21
replace tunisia=0 if tunisia==.

gen egypt=1 if country==5
replace egypt=0 if egypt==.

gen revpartb =1 if revpartun==1|revpartegy==1
replace revpartb=0 if revpartb==.

gen prpartb =1 if prpart==1|prparteg==1
replace prpartb=0 if prpartb==.

logit prpartb gender##tunisia

esttab, ///
se(3) b(3) mtitle("Model 1") /// 
 label nonumber noobs nobaselevels eqlabels(none) drop(_cons) ///
 title("Logistic regression: Tunisia gender interaction for participation in transitional period.") replace

logit prpartb gender##tunisia revpartb

esttab, ///
se(3) b(3) mtitle("Model 1") /// 
 label nonumber noobs nobaselevels eqlabels(none) drop(_cons) ///
 title("Logistic regression: Tunisia gender interaction controlling for previous revolutionary participation.")
